nLINKn is a small and simple
DLL that can create, edit and resolve shell links (shortcuts). It was
originally written as a sample for the “Tutorial on using and creating
mIRC DLLs”. The source code is included in the package; it is extensively
commented for everyone to examine it.
All the examples on this page
assume that the DLL has been copied into your main mIRC folder.
load, save
The ‘load’ function
loads a link from a .lnk file into memory where it can be examined/modified.
The ‘save’ function saves the link from memory to a .lnk file. Both
functions interpret the input string as the full name of the file:
echo -a
$dll(nLINKn,load,c:\mylink.lnk)
echo -a
$dll(nLINKn,save,c:\mylink2.lnk)
resolve
The ‘resolve’ function
tries to find the object the link in memory points to, even if it was renamed
or moved. The input argument is the number of seconds Windows is allowed to
search for the object.
echo -a $dll(nLINKn,resolve,5)
set, get
The ‘set’ and ‘get’ functions operate
on various information fields of the link in memory.
Valid fields are: l(abel),
a(rguments), d(irectory), p(ath), k(ey), s(how), i(con).
echo -a $dll(nLINKn,get,path)
echo -a
$dll(nLINKn,get,args)
echo -a
$dll(nLINKn,get,dir)
echo -a
$dll(nLINKn,get,label)
echo -a
$dll(nLINKn,get,key)
echo -a
$dll(nLINKn,get,show)
echo -a
$dll(nLINKn,get,icon)
Don’t forget to call the ‘save’
function to apply your changes.
specdir
The “specdir” function
returns the paths of special Windows directories. This can be useful when you
want to create a shortcut on the desktop or in the Startup folder, to get
access to the user’s “Favorites”, etc.
The input parameter can be
one of the following numbers:
System |
-2 |
Windows |
-1 |
Desktop |
0 |
Programs |
2 |
My Documents |
5 |
Favorites |
6 |
Startup |
7 |
Recent |
8 |
SendTo |
9 |
Start Menu |
11 |
Desktop |
16 |
Nethood |
19 |
Fonts |
20 |
Templates |
21 |
Application Data |
26 |
Printhood |
27 |
Internet Cache |
32 |
Cookies |
33 |
History |
34 |
For example, this code
creates a shortcut on the desktop:
echo -a
$dll(nLINKn,set,path c:\mydir\myscript.exe)
echo -a $dll(nLINKn,set,dir
c:\mydir)
echo -a
$dll(nLINKn,set,arguments /p /h)
echo -a
$dll(nLINKn,set,label this is optional)
echo -a
$dll(nLINKn,set,key 56)
echo -a
$dll(nLINKn,set,show 1)
echo -a
$dll(nLINKn,set,icon 25 $dll(nLINKn,specdir,-2) $+ \shell32.dll)
echo -a
$dll(nLINKn,save,$dll(nLINKn,specdir,0) $+ \mylink.lnk)
version
The ‘version’ function
provides information about the DLL and its author.
echo -a $dll(nLINKn,version,0)
Best wishes,
Necroman (#mIRC @ Undernet, http://necroman.wot.net, necroman@wot.net).
If you get no replies from me
via e-mail (it may happen after the 1st of June, 2001) ask your
questions in #mIRC or www.mircscripts.org/board.